-- GENERATED SPELL FOR [Living Monstrosity] --


function spell0_16021(pUnit, Event) --@Chain Lightning,n/a--
pUnit:FullCastSpellOnTarget(28293,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16021', 2000, 1)
end

function spell1_16021(pUnit, Event) --@Chain Lightning,n/a--
pUnit:FullCastSpellOnTarget(54334,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16021', 1500, 1)
end

function spell2_16021(pUnit, Event) --@Lightning Totem,Self--
pUnit:FullCastSpellOnTarget(28294,pUnit)
pUnit:RegisterEvent('Sorts_16021', 500, 1)
end

function Sorts_16021(pUnit, Event)
local choix_sorts_16021 = math.random(0, 2)
if choix_sorts_16021 == 0 then
pUnit:RegisterEvent('spell0_16021', 1, 1)
end
if choix_sorts_16021 == 1 then
pUnit:RegisterEvent('spell1_16021', 1, 1)
end
if choix_sorts_16021 == 2 then
pUnit:RegisterEvent('spell2_16021', 1, 1)
end
end

function mob16021_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_16021', math.random(1500, 3000), 1)
end

function mob16021_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16021_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16021_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(16021, 1, 'mob16021_Action')
RegisterUnitEvent(16021, 2, 'mob16021_Leave')
RegisterUnitEvent(16021, 3, 'mob16021_Kill')
RegisterUnitEvent(16021, 4, 'mob16021_Die')
